<template>
  <div class="app-container">
    <el-row style="padding-left: 80px" justify="space-between">
      <el-steps :active="active" align-center>
        <el-step title="选择赛制" style="width: 200px" />
        <el-step title="新建组别" style="width: 200px" />
      </el-steps>
    </el-row>
    <br />
    <el-card>
      <br />
      <br />
      <!--选着赛制-->
      <LeagueListAdd
        v-if="active == 0"
        @nextStep="nextStep"
        :repair="repair"
        :signType="signType"
        :cptProjectId="cptProjectId"
        :cptId="cptId"
        :groupId="groupId"
      ></LeagueListAdd>
      <!--新建组别-->
      <LeagueListOc
        v-if="active == 1"
        @nextStep="nextStep"
        :cpt="cpt"
        :repair="repair"
        :signType="signType"
        :cptProjectId="cptProjectId"
        :cptId="cptId"
        :groupId="groupId"
      ></LeagueListOc>
    </el-card>
  </div>
</template>

<script setup>
import LeagueListAdd from "@/views/match/list/CompetitionProject/competitionAdd/Select";
import LeagueListOc from "@/views/match/list/CompetitionProject/competitionAdd/groups";
import { useRoute } from "vue-router";
const route = useRoute();
// 显示页
const active = ref(route.query.indx ? parseInt(route.query.indx) : 0);
// 项目类型
const signType = ref(route.query.signType);
// 是否编辑
const repair = ref(0);
// 项目id
const cptProjectId = ref(route.query.cptProjectId);
// 赛事id
const cptId = ref(route.query.cptId);
// 组id
const groupId = ref(route.query.groupId);
// 下一步
function nextStep(a, b, c, d, e) {
  if (a != undefined) active.value = a * 1; // 页面显示
  if (b != undefined) cptProjectId.value = b + ""; //项目id
  if (c != undefined) signType.value = c + ""; //项目类型
  if (d != undefined) repair.value = d + ""; //是否科编辑
  if (e != undefined) groupId.value = e + ""; //组id
  console.log(groupId.value);
}
</script>

<style scope></style>
